package cn.etynit.service.impl;

import cn.etynit.domain.UserFamily;
import cn.etynit.mapper.UserFamilyMapper;
import cn.etynit.service.IUserFamilyService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author etyn
 * @since 2022-12-08
 */
@Service
public class UserFamilyServiceImpl extends ServiceImpl<UserFamilyMapper, UserFamily> implements IUserFamilyService {

    /**
     * 根据姓名和电话查询业主家庭成员
     * @param name
     * @param phone
     * @return
     */
    @Override
    public UserFamily visitor(String name, String phone) {
        Wrapper<UserFamily> wrapper = new EntityWrapper<>();
        wrapper.eq("family_name",name);
        wrapper.eq("family_phone",phone);
        return selectOne(wrapper);
    }
}
